<?php
/**
 * Created by PhpStorm.
 * User: yangyou
 * Date: 2018/12/10 0010
 * Time: 15:33
 */

namespace app\index\model;
use tools\PinYin;

class InformationClassification extends Base
{
    /**
     * Author:yang you
     * Time:2018-12-10 10:27:51
     * Describe:资讯种类
     * @return int|string
     */
    public function informationClassificationList($parent_id="0",$is_index=""){
        $select = $this->field("classification_name,classification_id,seo_keyword,seo_description,description")->where("parent_id",$parent_id)->where("is_index",$is_index)->orderRaw("sort desc")->select();
        $PinYin = new PinYin();
        foreach ($select as $key=>$val){
            $select[$key]['py'] = $PinYin->getPinYin($val["classification_name"]);
        }
        return $select;
    }


}